<div class="modal" tabindex="-1" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog"  style=" width: 1000px;">
        <div class="modal-content">
            <form name="userForm" novalidate>
                <div class="modal-header">
                    <button type="button" class="close" ng-click="close(false)" data-dismiss="modal"
                            aria-hidden="true">&times;</button>
                    <h4 class="modal-title">&nbsp;{{modalTitle}}&nbsp;</h4>
                </div>

                <div class="modal-body">
                    <div class="panel-body">
                        <div class="row">
                            <div class="input-group pdb15">
                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">优惠名称：
                                        <span ng-show="userForm.name.$error.required || userForm.name.$invalid" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="text"  name="name" class="form-control" ng-model="q.name" required>
                                    </div>
                                    <label class="col-md-2 control-label input-label">优惠类型：
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <select name="discountType" ng-model="discountType" ng-options="discountType for discountType in vm.discountType" class="form-control" ng-selected="" ng-change="discountTypeChange()"></select>
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">开始时间：
                                        <span ng-show="userForm.startCoupon.$error.required || userForm.startCoupon.$invalid" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="text"  name="startCoupon" id="datetimepickerStartCoupon"  class="form-control" ng-model="q.startTime" required>
                                    </div>
                                    <label class="col-md-2 control-label input-label">结束时间：
                                        <span ng-show="userForm.endCoupon.$error.required || userForm.endCoupon.$invalid" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="text"  name="endCoupon" id="datetimepickerEndCoupon"  class="form-control" ng-model="q.endTime" required>
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 15px">
                                        <label class="col-md-2 control-label input-label">客户类型：
                                            <span ng-show="isCreate" style="color:red">*</span></label>
                                        <div class="col-md-3 input-width-sm">
                                            <select name="discountConditionType" ng-model="type" ng-options="discountConditionType for discountConditionType in vm.discountConditionType" class="form-control" ng-selected=""ng-change="selectChange()" ></select>
                                        </div>
                                        <label class="col-md-2 control-label input-label">客户规格：
                                            <span ng-show="isCreate" style="color:red">*</span></label>
                                        <div class="col-md-3 input-width-sm">
                                            <select name="discountConditionValue" ng-model="value" ng-options="x.code as x.name for x in temp.customersList" class="form-control" ng-selected="" ng-change="customersLevelTypeChange()"></select>
                                        </div>
                                    </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">商品类型：
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <select name="goodsType" ng-model="temp.selectedGoodsType" ng-options="goodsType.name for goodsType in temp.goodsTypesList" class="form-control" ng-selected="" ng-change="goodsTypeChange()"></select>
                                    </div>
                                    <label class="col-md-2 control-label input-label">商品规格：
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <select name="goods" ng-model="temp.selectedGoods" ng-options="goods.name for goods in temp.goodsList" class="form-control" ng-selected="" ng-change="goodsChange()"></select>
                                    </div>

                                </div>


                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">所属区域：</label>
                                    <div class="col-md-3" input-width-sm>
                                        <select name="province" ng-model="vm.goods.area.province" ng-options="province for province in config.provinces" class="form-control" ng-selected="" ng-change="provincesChange()"></select>
                                    </div>
                                    <div class="col-md-3" input-width-sm>
                                        <select name="city" ng-model="vm.goods.area.city" ng-options="city for city in config.citys" class="form-control" ng-selected="" ng-change="citysChange()"></select>
                                    </div>
                                    <div class="col-md-4" input-width-sm>
                                        <select name="county" ng-model="county" ng-options="county for county in config.countys" class="form-control" ng-selected="" ng-change="countysChange()"></select>
                                    </div>
                                </div>


                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">现价：</label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="number"  class="form-control" ng-model="temp.selectedGoods.price" disabled>
                                    </div>
                                    <label class="col-md-2 control-label input-label">{{vm.discountText}}
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <input type="number"  class="form-control" ng-model="temp.adjustGoodsPrice" >
                                    </div>

                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label class="col-md-2 control-label input-label">使用方式：
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                    <div class="col-md-3 input-width-sm">
                                        <select name="useType" ng-model="useType" ng-options="useType for useType in vm.useType" class="form-control" ng-selected=""ng-change="useTypeSelectChange()" ></select>
                                    </div>
                                    <div class="col-md-2 input-width-sm">
                                        <button type="button" class=" btn btn-sm btn-success pull-right" ng-click="addToCart()"><i class="fa fa-plus"></i>添加调价列表 </button>
                                    </div>
                                </div>

                                <div class="row" style="margin-top: 15px">
                                    <label style="margin-left:22px;" class="control-label input-label">添加调价列表:
                                        <span ng-show="isCreate" style="color:red">*</span></label>
                                </div>

                            </div>
                        </div>

                        <div class="row">
                            <table class="table table-bordered table-hover .table-condensed">
                                <thead>
                                    <tr>
                                    <td style="background: lightblue;text-align: center" width="8%">序号</td>
                                    <td style="background: lightblue;text-align: center" width="8%">商品号</td>
                                    <td style="background: lightblue;text-align: center" width="12%">商品名称</td>
                                    <td style="background: lightblue;text-align: center" width="10%">商品类型</td>
                                    <td style="background: lightblue;text-align: center" width="10%">商品规格</td>
                                    <td style="background: lightblue;text-align: center" width="9%">现价</td>
                                    <td style="background: lightblue;text-align: center" width="10%">{{vm.discountText}}</td>
                                    <td style="background: lightblue;text-align: center" width="5%">操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="adjustPriceDetail in vm.currentPriceAdjustment.adjustPriceDetailList">
                                    <td class="message">{{$index+1}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.code}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.name}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.goodsType.name}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.specifications}}</td>
                                    <td class="message">{{adjustPriceDetail.goods.price}}</td>
                                    <td class="message">{{adjustPriceDetail.discount}}</td>
                                    <td class="operate">
                                        <button title="删除" ng-click="deleteGoodsFromCart(adjustPriceDetail)" type="button" class="btn btn-primary btn-outline btn-xs">
                                            <i class="fa fa-trash-o"></i>
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>

                            <div class="row" style="margin-top: 15px">
                                <label style="margin-left:22px;color:red" class="control-label input-label" ng-show="isCreate">带*为必填项</label>
                            </div>
                        </div>
                        </div>
                </div>

                <div class="modal-footer">
                    <button type="submit"  ng-hide="q.discountStrategyStatus.index == 1 ? true : false"
                            ng-disabled="userForm.name.$error.required || userForm.startCoupon.$error.required || userForm.endCoupon.$error.required"
                            ng-click="submit(q);" class="btn btn-primary" data-dismiss="modal">保存</button>
                    <button type="button" ng-click="close(false)" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </form>
        </div>
    </div>
</div>